package reviewQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'POST'
        url value(consumer(regex('api/v2/subjectQuizzes/tasks/[0-9]+/assignments/[0-9]+/quizzes/[0-9]+/submission')), producer('api/v2/subjectQuizzes/tasks/1/assignments/1/quizzes/1/submission'))
        headers {
            contentType(applicationJsonUtf8())
            header("id", 1)
        }
        body("""{
            "userAnswer":"https://github.com/mahuanfy/pdfMake.git" 
            }
        """)
        bodyMatchers {
            jsonPath('$.userAnswer', byRegex(nonEmpty()))
        }
    }
    response {
        status 201
        bodyMatchers {
            jsonPath('$.id', byRegex(number()))
        }
    }
}